﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

//Write a program that fills and prints a matrix of size (n, n) as shown below: (examples for n = 4)

namespace Matrices
{
    class MatrixA
    {
        static void Main(string[] args)
        {
            int fillValue = 1;
            int[,] matrix = new int[4, 4];
            for (int col = 0; col < matrix.GetLength(0); col++)
            {
                for (int row = 0; row < matrix.GetLength(1); row++)
                {
                    matrix[row, col] = fillValue;
                    fillValue++;
                }
            }

            // Print the Matrix
            for (int row = 0; row < matrix.GetLength(0); row++)
            {
                for (int col = 0; col < matrix.GetLength(1); col++)
                {
                    Console.Write("{0,4}", matrix[row,col]);
                }
                Console.WriteLine();
            }

        }
    }
}
